app.service('proServ',[function($rootScope){
	var arr = [];
	this.addPro = function(item){
		var flag = false;
		arr.forEach(function(pro,i){
			if(item.user_id == pro.user_id){
				flag = true;
				return
			}
		})
		
		if(!flag){
			arr.push(item);
//			console.log(arr)
		}
	}
	this.getPro = function(){
		return arr;
	}
}])
	//----------------控制顶部导航栏--------------
	.service('navServ',function($state){
		this.posStyle = function (obj){
            //记录提示栏初始位置
            var height = obj.offset().top;

              $(window).on("scroll",function(){

                var scrollTop = $(this).scrollTop();

                scrollTop - height >=0 ?

                obj.css({"top":0,"position":"fixed"}):
                obj.css({"position":"absolute","top":"1rem"});
            });
        };
	})